Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for requestedAccessTokenVersion:null access tokens (iss sts.windows.net) #215

Closed
wants to merge 1 commit into from

Conversation

aleksandr-vin
Copy link

@aleksandr-vin aleksandr-vin commented Oct 24, 2024

Closes #214

Adds support for v1 access tokens, those with "iss": "https://sts.windows.net/...../".

Example to use would be:

azure_scheme = SingleTenantAzureAuthorizationCodeBearer(
    app_client_id=settings.APP_CLIENT_ID,
    tenant_id=settings.TENANT_ID,
    scopes=settings.SCOPES,
    access_token_version_one=True,
    audience=f"https://{settings.APP_CLIENT_ID}.my.fancy.service.io",
)

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.0%. Comparing base (2256921) to head (bc47fab).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files           6        6           
  Lines         267      268    +1     
=======================================
+ Hits          267      268    +1     
Files with missing lines Coverage Δ
fastapi_azure_auth/auth.py 100.0% <100.0%> (ø)

@JonasKs
Copy link
Member

JonasKs commented Oct 24, 2024

Hi,

I'm sorry, but I don't really want to support v1 tokens as Microsoft has retired them in 2022, and recommended everyone to upgrade. Link

I had token support before #200(but removed to keep this library as simple and maintainable as possible), so if you really need it, I'd recommend to either use your fork, use v4, or override this in your own app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for v1 tokens (requestedAccessTokenVersion: null or 1)
2 participants